package assignment10;

import java.io.*;

class ReadBinaryFile{
  public static void main ( String[] args ) {
    	String fileName = "G:\\Users\\IOtest\\MixedTypes.txt";
    	double sum = 0;
    	String ret = "";
    	try {
    	    DataInputStream instr = new DataInputStream(new BufferedInputStream(new FileInputStream(fileName)));
         try {
        	 sum += instr.readInt();
        	 sum += instr.readDouble();
        	 while(true)
        		 ret += instr.readChar();
         }
         catch ( EOFException  eof ) {
           System.out.println( "The sum is: " + sum );
           System.out.println(ret);
           instr.close();
         }
    }
    catch ( IOException iox ) {
    	    System.out.println("IO Problems with " + fileName ); 
    }
  }
}
